<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{margin: 0;padding: 0;}
        html,body{
            height: 100%;
            width: 100%;
        }
        .bg{
            width: 300px;
            height: 300px;
            border: 1px solid lightgray;
            position: relative;
            margin: auto;  /*水平方向上居中*/
            top: 50%;     /*div的上边框对应在屏幕在正中间*/
            margin-top: -150px;/**/
            box-shadow: 0 8px 16px 0 rgba(255,0,0,1);
        }
        h3{
            text-align: center;
        }
    </style>
</head>
<body>
<div class="bg">
    <div>
        <h3>UOLad实验室</h3>
        <form action="login" method="post">
            <div><label>用户名:</label> <input type="text" name="username"></div>
            <div><label>密码:</label> <input type="text" name="password"></div>
            <div>
                <input type="submit" value="登录">
            </div>
        </form>
    </div>
</div>
</body>
</html>